<!-- 常量设置 -->
<template>
  <div class="table">
    <el-tabs v-model="activeName">
      <el-tab-pane label="基础设置" name="one" v-if="showBasic">
        <BasicForm />
      </el-tab-pane>
      <el-tab-pane label="前端文案和支付宝链接设置" name="two" v-if="showMsg">
        <MsgForm />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script setup lang="ts" name="constantSetting">
import BasicForm from "@/components/configInfo/constantSetting/BasicForm.vue";
import MsgForm from "@/components/configInfo/constantSetting/MsgForm.vue";
import checkPermission from "@/directive/permission.ts"; // 权限判断函数

const activeName = ref("one");

const showBasic = computed(() => {
  return checkPermission("getBasic");
});
const showMsg = computed(() => {
  return checkPermission("getMsg");
});

watch(
  () => showBasic.value,
  val => {
    if (!val) activeName.value = "two";
  }
);
</script>

<style lang="scss" scoped></style>
